\(\int (d \sec (e+f x))^m (a+b \tan (e+f x)) \, dx\) [642]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [F]
   Fricas [F]
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 21, antiderivative size = 93 \[ \int (d \sec (e+f x))^m (a+b \tan (e+f x)) \, dx=\frac {b (d \sec (e+f x))^m}{f m}-\frac {a d \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1-m}{2},\frac {3-m}{2},\cos ^2(e+f x)\right ) (d \sec (e+f x))^{-1+m} \sin (e+f x)}{f (1-m) \sqrt {\sin ^2(e+f x)}} \]

[Out]

b*(d*sec(f*x+e))^m/f/m-a*d*hypergeom([1/2, 1/2-1/2*m],[3/2-1/2*m],cos(f*x+e)^2)*(d*sec(f*x+e))^(-1+m)*sin(f*x+
e)/f/(1-m)/(sin(f*x+e)^2)^(1/2)

Rubi [A] (verified)

Time = 0.08 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3567, 3857, 2722} \[ \int (d \sec (e+f x))^m (a+b \tan (e+f x)) \, dx=\frac {b (d \sec (e+f x))^m}{f m}-\frac {a d \sin (e+f x) (d \sec (e+f x))^{m-1} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1-m}{2},\frac {3-m}{2},\cos ^2(e+f x)\right )}{f (1-m) \sqrt {\sin ^2(e+f x)}} \]

[In]

Int[(d*Sec[e + f*x])^m*(a + b*Tan[e + f*x]),x]

[Out]

(b*(d*Sec[e + f*x])^m)/(f*m) - (a*d*Hypergeometric2F1[1/2, (1 - m)/2, (3 - m)/2, Cos[e + f*x]^2]*(d*Sec[e + f*
x])^(-1 + m)*Sin[e + f*x])/(f*(1 - m)*Sqrt[Sin[e + f*x]^2])

Rule 2722

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[Cos[c + d*x]*((b*Sin[c + d*x])^(n + 1)/(b*d*(n + 1
)*Sqrt[Cos[c + d*x]^2]))*Hypergeometric2F1[1/2, (n + 1)/2, (n + 3)/2, Sin[c + d*x]^2], x] /; FreeQ[{b, c, d, n
}, x] &&  !IntegerQ[2*n]

Rule 3567

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[b*((d*Sec[
e + f*x])^m/(f*m)), x] + Dist[a, Int[(d*Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e, f, m}, x] && (IntegerQ[2
*m] || NeQ[a^2 + b^2, 0])

Rule 3857

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(b*Csc[c + d*x])^(n - 1)*((Sin[c + d*x]/b)^(n - 1)
*Int[1/(Sin[c + d*x]/b)^n, x]), x] /; FreeQ[{b, c, d, n}, x] &&  !IntegerQ[n]

Rubi steps \begin{align*} \text {integral}& = \frac {b (d \sec (e+f x))^m}{f m}+a \int (d \sec (e+f x))^m \, dx \\ & = \frac {b (d \sec (e+f x))^m}{f m}+\left (a \left (\frac {\cos (e+f x)}{d}\right )^m (d \sec (e+f x))^m\right ) \int \left (\frac {\cos (e+f x)}{d}\right )^{-m} \, dx \\ & = \frac {b (d \sec (e+f x))^m}{f m}-\frac {a \cos (e+f x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1-m}{2},\frac {3-m}{2},\cos ^2(e+f x)\right ) (d \sec (e+f x))^m \sin (e+f x)}{f (1-m) \sqrt {\sin ^2(e+f x)}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.26 (sec) , antiderivative size = 65, normalized size of antiderivative = 0.70 \[ \int (d \sec (e+f x))^m (a+b \tan (e+f x)) \, dx=\frac {(d \sec (e+f x))^m \left (b+a \cot (e+f x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {m}{2},\frac {2+m}{2},\sec ^2(e+f x)\right ) \sqrt {-\tan ^2(e+f x)}\right )}{f m} \]

[In]

Integrate[(d*Sec[e + f*x])^m*(a + b*Tan[e + f*x]),x]

[Out]

((d*Sec[e + f*x])^m*(b + a*Cot[e + f*x]*Hypergeometric2F1[1/2, m/2, (2 + m)/2, Sec[e + f*x]^2]*Sqrt[-Tan[e + f
*x]^2]))/(f*m)

Maple [F]

\[\int \left (d \sec \left (f x +e \right )\right )^{m} \left (a +b \tan \left (f x +e \right )\right )d x\]

[In]

int((d*sec(f*x+e))^m*(a+b*tan(f*x+e)),x)

[Out]

int((d*sec(f*x+e))^m*(a+b*tan(f*x+e)),x)

Fricas [F]

\[ \int (d \sec (e+f x))^m (a+b \tan (e+f x)) \, dx=\int { {\left (b \tan \left (f x + e\right ) + a\right )} \left (d \sec \left (f x + e\right )\right )^{m} \,d x } \]

[In]

integrate((d*sec(f*x+e))^m*(a+b*tan(f*x+e)),x, algorithm="fricas")

[Out]

integral((b*tan(f*x + e) + a)*(d*sec(f*x + e))^m, x)

Sympy [F]

\[ \int (d \sec (e+f x))^m (a+b \tan (e+f x)) \, dx=\int \left (d \sec {\left (e + f x \right )}\right )^{m} \left (a + b \tan {\left (e + f x \right )}\right )\, dx \]

[In]

integrate((d*sec(f*x+e))**m*(a+b*tan(f*x+e)),x)

[Out]

Integral((d*sec(e + f*x))**m*(a + b*tan(e + f*x)), x)

Maxima [F]

\[ \int (d \sec (e+f x))^m (a+b \tan (e+f x)) \, dx=\int { {\left (b \tan \left (f x + e\right ) + a\right )} \left (d \sec \left (f x + e\right )\right )^{m} \,d x } \]

[In]

integrate((d*sec(f*x+e))^m*(a+b*tan(f*x+e)),x, algorithm="maxima")

[Out]

integrate((b*tan(f*x + e) + a)*(d*sec(f*x + e))^m, x)

Giac [F]

\[ \int (d \sec (e+f x))^m (a+b \tan (e+f x)) \, dx=\int { {\left (b \tan \left (f x + e\right ) + a\right )} \left (d \sec \left (f x + e\right )\right )^{m} \,d x } \]

[In]

integrate((d*sec(f*x+e))^m*(a+b*tan(f*x+e)),x, algorithm="giac")

[Out]

integrate((b*tan(f*x + e) + a)*(d*sec(f*x + e))^m, x)

Mupad [F(-1)]

Timed out. \[ \int (d \sec (e+f x))^m (a+b \tan (e+f x)) \, dx=\int {\left (\frac {d}{\cos \left (e+f\,x\right )}\right )}^m\,\left (a+b\,\mathrm {tan}\left (e+f\,x\right )\right ) \,d x \]

[In]

int((d/cos(e + f*x))^m*(a + b*tan(e + f*x)),x)

[Out]

int((d/cos(e + f*x))^m*(a + b*tan(e + f*x)), x)